package com.etoak.controller;

import com.etoak.entity.Appointment;
import com.etoak.entity.Doctor;
import com.etoak.service.AppointmentService;
import com.etoak.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/appointment")
public class AppointmentController {
    @Autowired
    AppointmentService appointmentService;

    @PostMapping
    public ResultVO<Object> add(@Validated @RequestBody Appointment appointment){
        appointmentService.add(appointment);
        return ResultVO.success();
    }
}
